<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@page isELIgnored="false" %>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>测试CRUD</title>
        <link rel="stylesheet" type="text/css" href="framework/bootstrap/css/bootstrap.min.css"/>
    </head>
    <body>
    	<nav class="navbar navbar-default">
    		<div class="container-fluid">
    			<div class="navbar-header">
    					<a href="#" class="navbar-brand">按用户名搜索</a>
    			</div>
    			<div>
    				<form action="init.do" mehtod="post" class="navbar-form navbar-left">
    					<div class="form-group">
    						<input type="text" name="conds" placeholder="请输入姓名" class="form-control" />
    					</div>
    					<input type="hidden" name="curr" value="${pb.pip.currentPage }" />
    					<button type="submit" class="btn btn-default">搜索</button>
    				</form>
    			</div>
    			<ul class="nav navbar-nav navbar-right">
    				<li><a href="#regModal" data-toggle="modal"><span class="glyphicon glyphicon-user"></span>注册新用户</a></li>
    			</ul>
    		</div>
    	</nav>
    	<div class="container">
    		<div class="row">
    			<div class="col-xs-offset-1 col-xs-10">
    				<table class="table table-striped table-hover table-bordered text-center">
    					<tr>
    						<th class="text-center bg-primary">用户编号</th>
    						<th class="text-center bg-primary">用户头像</th>
    						<th class="text-center bg-primary">用户姓名</th>
    						<th class="text-center bg-primary">用户生日</th>
    						<th class="text-center bg-primary">存款总额</th>
    						<th class="text-center bg-primary">删除用户</th>
    					</tr>
    					<c:forEach items="${pb.data }" var="us">
    					<tr>
    						<td>${us.userid }</td>
    						<td><img src="upload/${us.userphoto }" alt="user" height="20px" width="20px"/></td>
    						<td>${us.username }</td>
    						<td>${us.birthday }</td>
    						<td>${us.money }</td>
    						<td><a href="del.do?userid=${us.userid}" class="btn btn-xs btn-danger">删除用户</a></td>
    					</tr>
    					</c:forEach>
    				</table>
    			</div>
    		</div>
    		<div class="row">
    			<div class="col-xs-offset-4 col-xs-4">
    				<ul class="pagination">
    					<li><a href="init.do?currentPage=1">首页</a></li>
    					<li><a href="init.do?currentPage=${pb.prev}">上页</a></li>
    					<li><a href="init.do?currentPage=${pb.next}">下页</a></li>
    					<li><a href="init.do?currentPage=${pb.countPage }">尾页</a></li>
    				</ul>
    			</div>
    		</div>
    	</div>
    	<div class="modal fade" aria-hidden="true" id="regModal">
    		<div class="modal-dialog">
    			<div class="modal-content">
    				<div class="modal-header">
    					<button type="button" data-dismiss="modal" aria-hidden="ture" class="close">&times;</button>
    					<h4 class="modal-title">新用户注册</h4>
    				</div>
    				<div class="modal-body">
    					<form action="" role="form" id="frmReg" enctype="multipart/form-data" class="form-horizontal">
    						<div class="form-group">
    							<label for="" class="control-label col-xs-3">用户姓名</label>
    							<div class="col-xs-9"><input type="text" name="username" placeholder="请输入信息" class="form-control" /></div>
    						</div>
    						<div class="form-group">
    							<label for="" class="control-label col-xs-3">用户生日</label>
    							<div class="col-xs-9"><input type="date" name="birthday" placeholder="请输入信息" class="form-control" /></div>
    						</div>
    						<div class="form-group">
    							<label for="" class="control-label col-xs-3">存入金额</label>
    							<div class="col-xs-9"><input type="number" name="balance" min="1" placeholder="请输入信息" class="form-control" /></div>
    						</div>
    						<div class="form-group">
    							<label for="" class="control-label col-xs-3">用户头像</label>
    							<div class="col-xs-9"><input type="file" name="file" placeholder="请输入信息" class="form-control" /></div>
    						</div>
    					</form>
    				</div>
    				<div class="modal-footer"><button type="button" id="btnSub" class="btn btn-primary">提交用户数据</button></div>
    			</div>
    		</div>
    	</div>
    	<script src="framework/jquery/jquery-3.2.1.min.js" type="text/javascript" charset="utf-8"></script>
    	<script src="framework/bootstrap/js/bootstrap.min.js" type="text/javascript" charset="utf-8"></script>
    	<script src="js/index.js" type="text/javascript" charset="utf-8"></script>
 	</body>
</html>